xen: stringify assertion condition for printing sooner.
authorKeir Fraser <keir@xen.org>
Tue, 18 Jan 2011 09:01:57 +0000 (09:01 +0000)
committerKeir Fraser <keir@xen.org>
Tue, 18 Jan 2011 09:01:57 +0000 (09:01 +0000)
So that:
(XEN) Assertion '!(((*({ unsigned long __ptr; __asm__ ("" :
"=r"(__ptr) : "0"(&per_cpu____preempt_count));
(typeof(&per_cpu____preempt_count)) (__ptr +
(get_cpu_info()->per_cpu_offset)); }))) ||
((irq_stat[(((get_cpu_info()->processor_id)1...
becomes:
(XEN) Assertion '"!in_atomic()"' failed at softirq.c:61

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
xen/include/asm-x86/bug.h
xen/include/xen/lib.h

index 60efca2244b8d8bb2cf289cc8876f8311ef24426..05083e016827d9f89ddb1817b996865da2af61bc 100644 (file)
@@ -40,7 +40,7 @@ struct bug_frame {
     asm volatile (                                 \
         "ud2 ; ret %0" BUG_STR(1) BUG_STR(2)       \
         : : "i" (BUGFRAME_assert | (__LINE__<<2)), \
-            "i" (__FILE__), "i" (#p) )
+            "i" (__FILE__), "i" (p) )
 
 
 #endif /* __X86_BUG_H__ */
index 7e25cb5a2966bb242b46d2c1927558645b4605cf..65e4fb8bdcdf56baf78456e49b24c629b2673daf 100644 (file)
@@ -27,7 +27,7 @@ void __warn(char *file, int line);
 #ifndef assert_failed
 #define assert_failed(p)                                        \
 do {                                                            \
-    printk("Assertion '%s' failed, line %d, file %s\n", #p ,    \
+    printk("Assertion '%s' failed, line %d, file %s\n", p ,     \
                    __LINE__, __FILE__);                         \
     BUG();                                                      \
 } while (0)
@@ -35,7 +35,7 @@ do {                                                            \
 
 #ifndef NDEBUG
 #define ASSERT(p) \
-    do { if ( unlikely(!(p)) ) assert_failed(p); } while (0)
+    do { if ( unlikely(!(p)) ) assert_failed(#p); } while (0)
 #else
 #define ASSERT(p) ((void)0)
 #endif